package cs341.cs.uwosh.edu.jBeats;

import java.util.*;

public class Song{
        private String name, album, artist, review, filePath, genre;
        private   int length, songID;
        private   double rating, averageRating;

        public Song(){
            filePath = "";
        }
        
        public Song(String filePath)
        {
                getMetaData(filePath);
                rating = 0;
                averageRating = 0;
                //assign songid by key in db
        }

        private   void getMetaData(String filePath)
        {
                
        }
        
        //x is the new rating that will be added into the average rating for the song
        private   void updateAverageRating(double x)
        {       
                //numberofratings*oldrating + newrating / new number of ratings
                //connect to DB and update
        }
        //get methods
        public   String getName() { return name; }
        public   String getAlbum() { return album; }
        public   String getArtist() { return artist; }
        public   String getGenre() {return genre;}
        public   int getLength() { return length; }
        public   double getRating() { return rating; }
        public   int getSongID() { return songID; }
        public   double getAverageRating() { return averageRating; }
        public   String getReview() { return review; }
        public   String getFilePath() {return filePath; }  
                

        //set methods
        public   void setName(String x) {name = x;}
        public   void setAlbum(String x) {album = x;}
        public   void setArtist(String x) {artist = x;}
        public   void setGenre(String x) {genre = x;}
        public   void setLength(int x) {length = x;}
        public   void setRating(double x) 
        {
                rating = x;
        }
        
        public   void setReview(String r) {review = r;}
        public void setAverageRating(double x){averageRating = x;}
        public   void setFilePath(String f) {filePath = f;}
        public void setID(int x) {songID = x;}
}